<?php
namespace app\admin\controller;
use think\Db;
class Common extends Base{
    public function welcome(){
    	$today=Db::name('users')->where('time','>=',strtotime(date('Y-m-d',time())))->count();
    	$history=Db::name('users')->where('time','<',strtotime(date('Y-m-d',time())))->count();
    	$orders_today=Db::name('orders')->where('time','>=',strtotime(date('Y-m-d',time())))->count();
    	$orders_history=Db::name('orders')->where('time','<',strtotime(date('Y-m-d',time())))->count();
        $this->assign('today',$today);
        $this->assign('history',$history);
        $this->assign('orders_today',$orders_today);
        $this->assign('orders_history',$orders_history);
        return $this->fetch();
    }
}
